/**
 * @Title: InsureOnItemClickListener.java
 * @Package com.bxd365.helper.view.listener
 * @Description: TODO(用一句话描述该文件做什么)
 * @author ChangJianlong
 * @date 2015-5-28 下午3:22:37 
 * @version V1.0
 */
package com.bxd.baodan.widget;

import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;

import java.util.Calendar;

/**
 * @author ChangJianlong
 * @ClassName: InsureOnItemClickListener
 * @Description:避免item连续点击
 * @date 2015-5-28 下午3:22:37
 */
public class InsureOnItemClickListener implements OnItemClickListener {
    public static final int MIN_CLICK_DELAY_TIME = 1000;
    private long lastClickTime = 0;

    @Override
    public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
        long currentTime = Calendar.getInstance().getTimeInMillis();
        if (currentTime - lastClickTime > MIN_CLICK_DELAY_TIME) {
            lastClickTime = currentTime;
            onMyItemClick(arg0, arg1, arg2, arg3);
        }
    }

    public void onMyItemClick(AdapterView<?> arg0, View arg1, int arg2,
                              long arg3) {
    }
}
